package controller.user.dish;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import model.VO.DishAndSetmealVO;
import service.Impl.DishServiceImpl;
import util.ResultUtil;

import java.io.IOException;

@WebServlet("/user/dish/find")
public class DishAndSetmealController extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String name=req.getParameter("name");
        DishServiceImpl dishService = new DishServiceImpl();
        DishAndSetmealVO dishAndSetmealVO=dishService.findDishAndSetmeal(name);
        String json= ResultUtil.getJSON(dishAndSetmealVO);
        resp.getWriter().write(json);
    }
}
